<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
      <%@ page import="java.sql.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String hotel = request.getParameter("hname");
String city = request.getParameter("city");
String score = request.getParameter("score");
/*
Class.forName("org.mariadb.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mariadb://10.220.140.102:3366/studb11","stua","zHZUA65r");
Statement stmt = connection.createStatement();
String sql = "INSERT INTO hotel(NAME,city,score) VALUE('"+hotel+"','"+city+"',"+score+")";
System.out.println("sql=" + sql);
int r = stmt.executeUpdate(sql);
System.out.println("影响行数为:"+ r);

stmt.close();
connection.close();
*/
String sql = "INSERT INTO hotel(NAME,city,score) VALUE('"+hotel+"','"+city+"',"+score+")";
System.out.println("sql=" + sql);
int ret = aa.db.DBTools.doSql(sql);
javax.sql.rowset.WebRowSet rs = aa.db.DBTools.getRS(sql);


response.sendRedirect("hotel.jsp");

%>


</body>
</html>